package com.arrogames.util {
	import feathers.controls.ToggleButton;
	
	import starling.display.Button;
	import starling.display.DisplayObject;
	import starling.display.Image;
	import starling.events.Event;
	import starling.textures.Texture;

	public class UIUtil {
		
		public static function move(displayObject:DisplayObject, x:int, y:int):DisplayObject {
			displayObject.x = x;
			displayObject.y = y;
			return displayObject;
		}
		
		public static function createButton(texture:Texture, x:int, y:int, clickHandler:Function):Button {
			var button:Button = new Button(texture);
			button.x = x;
			button.y = y;
			button.addEventListener(Event.TRIGGERED, clickHandler);
			return button;
		}
		
		public static function createToggleButton(selectedTexture:Texture, deselectedTexture:Texture, x:int, y:int, clickHandler:Function):ToggleButton {
			var button:ToggleButton = new ToggleButton();
			button.defaultSelectedSkin = new Image(selectedTexture);
			button.defaultSkin = new Image(deselectedTexture);
			button.x = x;
			button.y = y;
			button.addEventListener(Event.TRIGGERED, clickHandler);
			return button;
		}
		
	}
}